package edu.caltech.cs.cs141.CopilotWeb.shared;

import java.io.Serializable;

import javax.persistence.Id;

public class ClientTripHeader implements Serializable, Comparable<ClientTripHeader> {
	private static final long serialVersionUID = 5941274374066253174L;
	
	@Id long trip_id;
	String username;
	String triptype;
	int duration;
	int score;
	long triptime;
	double startlon;
	double startlat;
	double endlon;
	double endlat;
	
	public long getID() {
		return trip_id;
	}
	
	public String getType() {
		return triptype;
	}
	
	public int getDuration() {
		return duration;
	}
	
	public int getScore() {
		return score;
	}
	public long getStart() {
		return triptime;
	}
	
	public String getUsername() {
		return username;
	}
	
	public double getStartLat() {
		return startlat;
	}
	
	public double getStartLon() {
		return startlon;
	}
	
	public double getEndLat() {
		return endlat;
	}
	
	public double getEndLon() {
		return endlon;
	}

	public void setID(long time) {
		trip_id = time;	
	}
	
	public void setType(String type) {
		triptype = type;
	}
	
	public void setDuration(int _duration) {
		duration = _duration;
	}
	public void setScore(int _score) {
		score = _score;
	}
	
	public void setTriptime(long time) {
		triptime = time;
	}
	
	
	public void setData(String _username, long _trip_id, int _score, String _triptype, 
			int _duration, long _triptime, double _startlon, double _startlat, double _endlon, double _endlat) {
		username = _username;
		trip_id = _trip_id;
		score = _score;
		triptype = _triptype;
		duration = _duration;
		triptime = _triptime;
		startlon = _startlon;
		endlon = _endlon;
		startlat = _startlat;
		endlat = _endlat;
	}

	public int compareTo(ClientTripHeader h) {
		long start = h.getStart();
		return (int) (start - triptime)/1000;
	}

}
